<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <!-- MOTW-DISABLED saved from url=(0014)about:internet -->
    <title>Providing the ReportDesign.initialize code</title>
    <link rel="StyleSheet" href="css/ScriptingWithJavaScript.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="webworks.css" type="text/css" media="all" />
    <script type="text/javascript" language="JavaScript1.2">
      <!--
        var  WebWorksRootPath = "";
      // -->
    </script>
  </head>
  <body>
    <div style="text-align: left;">
      <table cellspacing="0" summary="">
        <tr>
          <td>
            <a href="ScriptingWithJavaScript.22.02.html"><img src="images/prev.gif" alt="Previous" border="0" /></a>
          </td>
          <td>
            <a href="ScriptingWithJavaScript.22.04.html"><img src="images/next.gif" alt="Next" border="0" /></a>
          </td>
        </tr>
      </table>
    </div>
    <hr align="left" />
    <blockquote>
      <h3 class="N_h2h_Head2Help"><a name="156537">Providing the ReportDesign.initialize code</a></h3>
      <p class="b_Body"><a name="151626">The following code in the ReportDesign.initialize method creates a file on your hard drive and adds one line to the file.</a></p>
      <div class="cf_CodeFirst"><a name="151627">importPackage(&nbsp;Packages.java.io&nbsp;);</a></div>
      <div class="co_Code"><a name="151628">fos = new java.io.FileOutputStream(&nbsp;"c:\\logFile.txt"&nbsp;);</a></div>
      <div class="co_Code"><a name="151629">printWriter = new java.io.PrintWriter(&nbsp;fos&nbsp;);</a></div>
      <div class="co_Code"><a name="151630">printWriter.println(&nbsp;"ReportDesign.initialize"&nbsp;);</a></div>
      <p class="b1i_Bullet1-intro"><a name="151631">The preceding code performs the following tasks:</a></p>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><a name="151632">Imports the Java package, java.io</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><a name="151634">Creates a file output stream for the file you want to create</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="b1_Bullet1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_Bullet1_inner" style="width: 14.1732pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_Bullet1_inner"><a name="151636">Creates a PrintWriter object that every script can use to track script execution sequence</a></div>
            </td>
          </tr>
        </table>
      </div>
      <h4 class="N_ht_HowTo"><a name="151640">How to provide code for the ReportDesign.initialize script</a></h4>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732pt; white-space: nowrap">
                <span class="zAuto_0023Format">1&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="151643">Choose the Script tab.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732pt; white-space: nowrap">
                <span class="zAuto_0023Format">2&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="151648">In Outline, select the top line, as shown in </a><a href="#152861" title="Providing the ReportDesign.initialize code">Figure&nbsp;22-2</a>.</div>
            </td>
          </tr>
        </table>
      </div>
      <p class="i2_Image2"><a name="151657"><img class="Default" src="images/SelectingReportDesign.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Figure 22-2 Selecting the report design" /></a></p>
      <div class="fc2_FigCall2Title">
        <b class="Bold">Figure&nbsp;22-2&nbsp;&nbsp;</b><a name="152861">Selecting the report design</a></div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732pt; white-space: nowrap">
                <span class="zAuto_0023Format">3&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="151658">In Script, select initialize.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732pt; white-space: nowrap">
                <span class="zAuto_0023Format">4&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="151659">Type the code into the script editor, as shown in </a><a href="#152863" title="Providing the ReportDesign.initialize code">Figure&nbsp;22-3</a>.</div>
            </td>
          </tr>
        </table>
      </div>
      <p class="i2_Image2"><a name="151675"><img class="Default" src="images/providingCode.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Figure 22-3 Providing ReportDesign.initialize code" /></a></p>
      <div class="fc2_FigCall2Title">
        <b class="Bold">Figure&nbsp;22-3&nbsp;&nbsp;</b><a name="152863">Providing ReportDesign.initialize code</a></div>
    </blockquote>
    <hr align="left" />
    <table align="right" summary="">
      <tr>
        <td class="WebWorks_Company_Name_Bottom">
          <a href="notices.html">(c) Copyright Actuate Corporation 2013</a>
        </td>
      </tr>
    </table>
  </body>
</html>